package demo.shiro;

import lombok.Data;

import java.io.Serializable;

/**
 * Shiro 自定义账号类
 *
 * @author 肖溥博文
 * @version 1.0
 */
@Data
public class AccountProfile implements Serializable {
    // If you name id as 'uid', you will get an error 400 like this:
    // class demo.shiro.AccountProfile must has getter for field: id
    // We need a field to identify this Cache Object in Redis.
    // So you need to defined an id field which you can get unique id to identify this principal.
    // For example, if you use UserInfo as Principal class, the id field maybe userId, userName, email, etc.
    // For example, getUserId(), getUserName(), getEmail(), etc.
    // Default value is "id", that means your principal object has a method called "getId()"
    private Long id;            // 用户 id
    private String position;    // 职位
}
